<template>
	<u-cell-group>
		<u-cell-item :arrow="false" icon="account-fill" title="用户姓名" :value="userData.userName"></u-cell-item>
		<u-cell-item :arrow="false" icon="coupon-fill" title="用户性别" :value="userData.sex=='1'?'男':'女'"></u-cell-item>
		<u-cell-item :arrow="false" icon="bookmark-fill" title="账户名称" :value="userData.loginName"></u-cell-item>
		<u-cell-item :arrow="false" icon="tags-fill" title="所属单位" :value="deptData.deptName"></u-cell-item>
		<u-cell-item :arrow="false" icon="phone-fill" title="手机号码" :value="userData.phone"></u-cell-item>
		<u-cell-item :arrow="false" icon="email-fill" title="电子邮箱" :value="userData.email"></u-cell-item>
		<u-cell-item :arrow="false" icon="clock-fill" title="创建时间" :value="userData.createTime"></u-cell-item>
		<u-cell-item :arrow="false" icon="clock-fill" title="最后一次登录时间" :value="userData.loginDate"></u-cell-item>
	</u-cell-group>
</template>

<script>
	export default {
		data() {
			return {
				userData: {},
				deptData: {},
			}
		},
		onShow() {
			this.loadUserInfo()
		},
		methods: {
			loadUserInfo() {
				this.$u.api.getUserInfo().then((res) => {
					this.userData = res.data
					this.deptData = res.data.dept
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>
